/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.ipmirror.common.base;

import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;

/**
 *
 * @author denny
 */
public abstract class AbstractModelBean {
    private final static Logger log=Logger.getLogger(AbstractModelBean.class);
    private String loginUserName;
    private String loginUserRole;
    private boolean readOnly;
    private boolean disabled;
    private boolean showConfirmPopup;

//    public AbstractModelBean() {
//    }

//    @PostConstruct
//    protected void init(){
//        showConfirmPopup=false;
//        readOnly=false;
//        disabled=false;
//    }


    public boolean isDisabled() {
        return disabled;
    }

    public void setDisabled(boolean disabled) {
        this.disabled = disabled;
    }

    public String getLoginUserName() {
        if(StringUtils.isBlank(loginUserName)){
            return "Anonymous";
        }
        return loginUserName;
    }

    public void setLoginUserName(String loginUserName) {
        this.loginUserName = loginUserName;
    }

    public String getLoginUserRole() {
        if(StringUtils.isBlank(loginUserRole)){
            return "Guest";
        }
        return loginUserRole;
    }

    public void setLoginUserRole(String loginUserRole) {

        this.loginUserRole = loginUserRole;
    }

    public boolean isReadOnly() {
        return readOnly;
    }

    public void setReadOnly(boolean readOnly) {
        this.readOnly = readOnly;
    }

    public boolean isShowConfirmPopup() {
        return showConfirmPopup;
    }

    public void setShowConfirmPopup(boolean showConfirmPopup) {
        this.showConfirmPopup = showConfirmPopup;
    }

}
